package cn.tradewin.pmp.mixins;

import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ClientElement;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.InjectContainer;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;

public class TextboxHint {

	@Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
	private String hintText;

	@Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
	private String hintColor;

	@Environmental
	private JavaScriptSupport jss;

	@InjectContainer
	private ClientElement clientElement;

	public void afterRender() {
		 jss.require("textbox-hint").with(clientElement.getClientId(), hintText, hintColor);
	}

}
